import request from '@/utils/request'


export function menuList(data) {
    return request({
        url: '/system/sys-menu/menuList',
        method: 'post',
        data
    })
}

export function menuInfo(menuId) {
    return request({
        url: '/system/sys-menu/' + menuId,
        method: 'get'
    })
}

// 查询菜单下拉树结构
export function treeSelect() {
    return request({
        url: '/system/sys-menu/TreeSelect',
        method: 'get'
    })
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeSelect(roleId) {
    return request({
        url: '/system/sys-menu/roleMenuTreeSelect/' + roleId,
        method: 'get'
    })
}

export function addMenu(data) {
    return request({
        url: '/system/sys-menu/add',
        method: 'post',
        data: data
    })
}

export function updateMenu(data) {
    return request({
        url: '/system/sys-menu/edit',
        method: 'put',
        data: data
    })
}

export function deleteMenu(menuId) {
    return request({
        url: '/system/sys-menu/' + menuId,
        method: 'delete'
    })
}
